classdef CommonMultiLabelMetric < MultiLabelMetric
    %COMMONMULTILABELMETRIC Summary of this class goes here
    %   Detailed explanation goes here
    
    properties
    end
    
    methods ( Static = true )
        function [ result ] = calc( Y, Y_hat, Y_out )
            if nargin < 2
                error('BatErr: Invalid input arguments.')
            end
            
            result.avgprec = AveragePrecision.calc(Y, Y_hat, Y_out);
            result.rankloss = RankingLoss.calc(Y, Y_hat, Y_out);
            result.onerr = OneError.calc(Y, Y_hat, Y_out);
            result.cover = Coverage.calc(Y, Y_hat, Y_out);
            result.ranksen = RankingSensitivity.calc(Y, Y_hat, Y_out);
            result.rankrec = RankingRecall.calc(Y, Y_hat, Y_out);
            result.rankf1 = 2*result.ranksen*result.rankrec/...
                (result.ranksen + result.rankrec);
            
            result.hamloss = HammingLoss.calc(Y, Y_hat, Y_out);
            result.macf1 = MultiLabelMacroF1Measure.calc(Y, Y_hat, Y_out);
            result.micf1 = MultiLabelMicroF1Measure.calc(Y, Y_hat, Y_out);
            [result.geof1, result.algf1] = ...
                MultiLabelGeometricF1Measure.calc(Y, Y_hat, Y_out);
        end
    end
    
end
